<template>
    <div class="detailPage">
        <div class="sc_location">
            <ul>
                <li style="width: 26px">
                    <img src="http://mall.huida.cc/picture/home/gallery/location.png" alt="" />
                </li>
                <li>首页</li>
                <li>{{category_name[0]?'-'+category_name[0]:''}}</li>
                <li>{{category_name[1]?'-'+category_name[1]:''}}</li>
            </ul>
        </div>
        <div class="sc_middle">
            <div class="leftPic">
                <div class="goodsPic">
                    <div class="previewPic" @mouseenter="doshow()" @mouseleave="markFlag = false" @mousemove="domove($event)" ref="previewPic">
                        <img ref="previewImg" style="width: 378px; height: 378px" :src="'http://mall.huida.cc'+image_list[0]" alt="" @error="handleError" />
                        <i class="act_tag" v-if="+goods.full"></i>
                        <i class="special_tag" v-if="goods.type===2"></i>
                        <i class="promotion_tag" v-if="goods.type===5"></i>
                        <div ref="mark" class="mark" v-if="markFlag"></div>
                        <div ref="largePic" class="largePic" v-if="markFlag"></div>
                    </div>
                    <div class="scrollPic">
                        <a class="prev" href="#" @click.prevent="doprev()"></a>
                        <a class="next" href="#" @click.prevent="donext()"></a>
                        <div class="items">
                            <ul ref="moveul">
                                <li v-for="(item, index) in image_list" :key="item" style="cursor: pointer;" :class="{ liselected: activeSelect === index }" @click="selectImg(item, index)">
                                    <i :class="{ iselected: activeSelect === index }"></i>
                                    <img :src="'http://mall.huida.cc'+item" alt="" @error="handleError" />
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="tooltip">
                    温馨提示<span style="color: #828181">图片仅供参考，请以实物为准。</span>
                </div>
            </div>
            <div class="rightDesc">
                <div class="goodsname">
                    <ul>
                        <li>{{goods.general_name}}</li>
                    </ul>
                    <div class="product-money">
                        <div class="product-money-left">
                            <div class="gongyin">
                                <span class="discount">特价</span>
                                <span class="count">
                                    <i class="discount-m">￥</i>
                                    <i class="count-m">{{goods.price}}</i>
                                </span>
                            </div>
                            <div class="lingshou">
                                <span style="font-size: 16px; color: #333333">售价</span>
                                <span style="display: flex">
                                    <i class="sale-mark">￥</i>
                                    <i class="sale-m">{{goods.retail_price}}</i>
                                </span>
                            </div>
                            <div class="coupon-later">
                                <span>{{goods.coupon_str}}</span>
                            </div>
                        </div>
                    </div>
                    <div class="salesbox" v-if="goods.full_info">
                        <b></b>
                        <ul class="inbox">
                            <li>
                                <i>促销</i>
                                <div class="saleContent">
                                    <span>
                                        {{goods.full_info}}
                                    </span>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div style="height:30px;position:relative;"></div>
                    <div class="sc_content">
                        <div class="sc_content_top">
                            <div class="sc_content_detail">
                                <div>
                                    <span style="margin-right: 10px">规格</span>
                                    <span>{{goods.norms}}</span>
                                </div>
                                <div>
                                    <span style="margin-right: 10px">单位</span>
                                    <span>{{goods.unit}}</span>
                                </div>
                                <div>
                                    <span style="margin-right: 10px">库存</span>
                                    <span>{{goods.stock>100?'&#62; 100':'&#60; 100' }}</span>
                                </div>
                            </div>
                            <div class="sc_content_quality">
                                <div>
                                    <span style="margin-right: 10px">计件量</span>
                                    <span>{{goods.number_package}}</span>
                                </div>
                                <div>
                                    <span style="margin-right: 10px">中包装</span>
                                    <span>{{goods.medium_package}}盒</span>
                                </div>
                            </div>
                        </div>
                        <div class="sc_content_mid">
                            <div class="mid_title">
                                <div style="display: flex; margin-bottom: 10px">
                                    <span class="first">厂商</span>
                                    <span class="second">{{goods.produce_unit}}</span>
                                </div>
                            </div>
                            <div class="mid_content">
                                <div class="mid_first">
                                    <span style="color: #999999; font-size: 16px">批准文号</span>
                                    <span style="color: #333333; font-size: 16px; margin-top: -8px">{{goods.license}}</span>
                                </div>
                                <div class="mid_first">
                                    <span style="color: #999999; font-size: 16px">产品编号</span>
                                    <span style="color: #333333; font-size: 16px; margin-top: -8px">{{goods.product_code}}</span>
                                </div>
                                <div class="mid_first">
                                    <span style="color: #999999; font-size: 16px">生产日期</span>
                                    <span style="color: #333333; font-size: 16px; margin-top: -8px">{{goods.produce_date}}</span>
                                </div>
                                <div class="mid_first">
                                    <span style="color: #999999; font-size: 16px">有效期至</span>
                                    <span style="color: #333333; font-size: 16px; margin-top: -8px">优于{{goods.last_date}}</span>
                                </div>
                                <div class="mid_first">
                                    <span style="color: #999999; font-size: 16px">供应批号</span>
                                    <span style="color: #333333; font-size: 16px; margin-top: -8px">以实物为准</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="shopping">
                        <div class="computed">
                            <a class="numup" href="#" @click.prevent="increase()">+</a>
                            <input class="countbox" type="text" v-model.number="count" />
                            <a class="numdown" href="#" @click.prevent="reduce()">-</a>
                            <span class="xiangou">限购<i style="color: #f92b2b">{{(goods.quota - goods.already)>0?goods.quota - goods.already:0}}</i></span>
                        </div>
                        <div class="addcar">
                            <a href="#" @click.prevent="addShopCar($event)" v-if="(goods.quota - goods.already)>0">
                                <img style="width: 21px; height: 20px; margin-right: 5px" src="http://mall.huida.cc/picture/home/shopcat.png" alt="" />
                                加入购物车
                            </a>
                            <a href="#" @click.prevent="" v-else style="background:#aeaeae;border: none;color:#000;cursor: not-allowed;">
                                <img style="width: 21px; height: 20px; margin-right: 5px" src="http://mall.huida.cc/picture/home/shopcat.png" alt="" />
                                加入购物车
                            </a>
                        </div>
                        <div class="buycar">
                            <a href="#" @click.prevent="$router.push('/cart')"> 立即购买 </a>
                        </div>
                        <a class="collect" @click.prevent="collect()">
                            <div class="line"></div>
                            <img ref="celloctImg" style="width: 16px; height: 16px; margin-right: 5px" :src="goods.fav?'http://mall.huida.cc/picture/home/shoucang-selected.png':'http://mall.huida.cc/picture/home/shoucang123.png'" alt="" />
                            <span style="font-size: 18px; color: #666">收藏</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <div class="sc_foot">
            <div class="recomend">
                <div class="recgoods">推荐商品</div>
                <template v-if="recomendList.length">
                    <div ref="recomendPic" class="recomendPic" v-for="(item,index) in recomendList" :key="index">
                        <a href="#" @click.prevent="goOthers(item.goods_id)" style="text-decoration: none; cursor: pointer; color: inherit">
                            <div class="recImg">
                                <img :src="'http://mall.huida.cc'+item.image[0]" alt="" />
                                <i class="act-tag-img" v-if="+item.full"></i>
                            </div>
                        </a>
                        <div ref="collectImg" class="collectImg" @click="recCollect(item.goods_id,index)" style="cursor: pointer;">
                            <a href="#" style="width:218px;dispaly:block;" @click.prevent="">
                                <div>
                                    <img  :src="item.fav?'http://mall.huida.cc/picture/home/sc4.png':'http://mall.huida.cc/picture/home/sc3.png'" alt="">
                                </div>
                                <i ref="collectTxt">{{item.fav?'已收藏':'加入收藏'}}</i>
                            </a>
                        </div>
                        <a href="#" @click.prevent="goOthers(item.goods_id)">
                            <p>通用名：{{item.general_name}}</p>
                            <p>生产商：{{item.produce_unit}}</p>
                            <p> 供应价：<span style="color:red;font-size: 18px;">
                                    <i style="font-size: 12px;">￥</i>
                                    <span>{{item.price}}</span>
                                </span></p>
                            <div style="padding-left: 10px;height: 30px;"></div>
                        </a>
                        <div class="recCar">
                            <div class="counter">
                                <a href="#" @click.prevent="recReduce(item.goods_id)">-</a>
                                <input type="text" v-model="item.count" @input="recInput(item.goods_id)">
                                <a href="#" @click.prevent="recAdd(item.goods_id)">+</a>
                            </div>
                            <a href="#" @click.prevent="addShopCar($event,item.goods_id,item.count)" class="add-car">
                                <img style="width: 21px; height: 20px;margin-right: 5px;" src="http://mall.huida.cc/picture/home/shopcat.png" alt="">
                                加入采购车
                            </a>
                        </div>
                        <div ref="store" class="store">
                            <p>批 号：以实物为准</p>
                            <p>库 存：{{item.quota-item.already>100?'&#62; 100':'&#60; 100' }}</p>
                        </div>
                    </div>
                </template>
                <div v-else class="defaultRecomend">
                    <img src="http://mall.huida.cc/picture/home/pro_null.png" alt="" />
                    <p>抱歉，暂无相关推荐商品，我们会尽快完善，敬请期待！</p>
                </div>
            </div>
            <div class="goodsdetail">
                <div class="detailList">
                    <ul>
                        <li v-for="(item, index) in selectLiItem" :key="item" :class="{
                selectLi: activeLi === index,
                defaultBorder: activeLi === 0,
              }" @click="activeLi = index">
                            {{ item }}
                            <i :class="{ i1: activeLi === index }"></i>
                            <i :class="{ i2: activeLi === index }"></i>
                        </li>
                    </ul>
                </div>
                <div class="detailContent">
                    <ul>
                        <li v-show="activeLi === 0" v-html="goods.introduc"></li>
                        <li v-show="activeLi === 1">
                            <div class="search">
                                按批号搜索
                                <input type="text" v-model="batch_code" />
                                <a class="a1" href="#" @click.prevent="goodsDownload">下载商品证件</a>
                                <a class="a2" href="#" @click.prevent="codeSearch">搜索</a>
                            </div>
                        </li>
                        <li v-show="activeLi === 2" v-html="goods.introduc"></li>
                        <li v-show="activeLi === 3">
                            <div style="
                  width: 710px;
                  height: 430px;
                  align: center;
                  margin-top: 30px;
                  margin-left: 70px;
                  float: left;
                ">
                                <div style="margin-bottom: 26px; margin-left: 42px; float: left">
                                    <div style="font-size: 16px; font-weight: bold; float: left">
                                        电话
                                    </div>
                                    <div style="float: left">
                                        <input style="
                        text-indent: 4px;
                        display: block;
                        width: 551px;
                        height: 28px;
                      " placeholder=" 请输入您的电话号码，方便我们和你取得联系" type="text" v-model="tel" />
                                    </div>
                                </div>
                                <div style="margin-left: 42px; margin-bottom: 22px; float: left">
                                    <div style="font-size: 16px; font-weight: bold; float: left">
                                        内容
                                    </div>
                                    <div style="float: left">
                                        <textarea placeholder="150字以内" cols="76" rows="16" style="resize: none" v-model="content"></textarea>
                                    </div>
                                </div>
                                <div style="
                                      margin-left: 98px;
                                      color: red;
                                      font-size: 16px;
                                      font-weight: bold;
                                      float: left;
                                      ">请留下您的宝贵意见，我们客服人员会联系您，接洽您对此商品的相关宜事！
                                </div>
                                <div style="margin-top: 4px; float: left">
                                    <a class="addbtn" href="#" @click.prevent="writeMessage">添加留言</a>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import defaultImg from "@/minixs/defaultImg";
import { getDetails, doCollect, addCar, searchBatch, download, addMessage } from '../../api/details'
import { handleExportZip } from '../../utils/tools'
export default {
    data() {
        return {
            count: 1,
            markFlag: false,
            activeSelect: 0,
            activeLi: 0,
            selectLiItem: ["商品说明书", "检验资料", "产品介绍", "商品留言"],
            goods: {},
            image_list: [],
            recomendList: [],
            category_name: [],
            batch_code: '',
            tel: '',
            content: '',
        };
    },
    mixins: [defaultImg],
    created() {
        this.getDetailList()
    },
    methods: {
        //获取数据
        async getDetailList() {
            const { data: { data } } = await getDetails(this.$route.query.id)
            this.goods = data
            this.category_name = data.category_name
            this.image_list = data.image
            this.recomendList = data.recommend
            this.count = data.quota - data.already <= 0 ? 0 : data.is_separate === 1 ? data.pack : 1
        },
        // 进入显示遮罩层和放大镜
        doshow() {
            this.markFlag = true;
            this.$nextTick(() => {
                if (this.$refs.largePic) {
                    this.$refs.largePic.style.backgroundImage = `url(${this.$refs.previewImg.src})`;
                }
            });
        },
        // 放大镜移动
        domove(e) {
            if (this.$refs.mark) {
                let x = e.offsetX - this.$refs.mark.offsetWidth / 2;
                let y = e.offsetY - this.$refs.mark.offsetHeight / 2;
                const maxx = this.$refs.previewPic.offsetWidth - this.$refs.mark.offsetWidth;
                const maxy = this.$refs.previewPic.offsetHeight - this.$refs.mark.offsetHeight;
                x = x < 0 ? 0 : x;
                x = x > maxx ? maxx : x;
                y = y < 0 ? 0 : y;
                y = y > maxy ? maxy : y;
                this.$refs.mark.style.left = x + "px";
                this.$refs.mark.style.top = y + "px";
                this.$refs.largePic.style.backgroundPosition = `${-2 * x}px ${-2 * y}px`;
            }
        },
        //向前切换
        doprev() {
            if (this.activeSelect > 0) {
                this.activeSelect--;
                this.$refs.previewImg.src = 'http://mall.huida.cc' + this.image_list[this.activeSelect];
            }
        },
        //向后切换
        donext() {
            if (this.activeSelect < this.image_list.length - 1) {
                this.activeSelect++;
                this.$refs.previewImg.src = 'http://mall.huida.cc' + this.image_list[this.activeSelect];
            }
        },
        //点击切换
        selectImg(item, index) {
            this.activeSelect = index;
            this.$refs.previewImg.src = 'http://mall.huida.cc' + item;
        },
        //点击添加购物车
        async addShopCar(e, goods_id = this.goods.goods_id, quantity = this.count) {
            const res = await addCar({
                goods_id,
                quantity
            });
            if (res.data.status !== 1) {
                this.$message({
                    message: res.data.msg,
                    type: "warning"
                });
            } else {
                this.$message({
                    message: "添加成功",
                    type: "success"
                });
            }
        },
        //点击收藏
        collect() {
            doCollect(this.goods.goods_id)
            this.goods.fav = !this.goods.fav
            this.goods.fav ? this.$message({
                message: '收藏成功',
                type: "success"
            }) : this.$message('取消收藏')
        },
        //点击增加数量
        increase() {
            if (this.goods.quota - this.goods.already <= 0) {
                this.count = 0
                return this.$message("抱歉，已超过该商品限购量")
            }
            this.goods.is_separate === 1
                ? this.count += this.goods.pack
                : this.count++;

        },
        //点击减少数量
        reduce() {
            if (this.goods.is_separate === 1) {
                if (this.count <= this.goods.pack) return this.count = this.goods.pack
                return this.count -= this.goods.pack
            }
            if (this.count <= 1) return;
            this.count--;
        },
        // 推荐模块添加收藏
        recCollect(id) {
            doCollect(id)
            const item = this.recomendList.find((item) => {
                return item.goods_id === id
            })
            item.fav = !item.fav
            item.fav ? this.$message({
                message: '收藏成功',
                type: "success"
            }) : this.$message('取消收藏')
        },
        //推荐模块购物车加减
        recAdd(id) {
            this.recomendList.forEach(item => {
                if (item.goods_id === id) {
                    if (item.count >= item.quota - item.already) {
                        this.$message("抱歉，已超过该商品限购量")
                        item.count = item.is_separate === 1
                            ? Math.floor((item.quota - item.already) / item.pack) * item.pack
                            : item.quota - item.already;
                    } else {
                        if (item.is_separate === 1) {
                            item.count += item.pack;
                        } else {
                            item.count++;
                        }
                    }
                }
            });
        },
        recReduce(id) {
            this.recomendList.forEach(item => {
                if (item.goods_id === id) {
                    if (item.is_separate === 1) {
                        if (item.count <= item.pack) return item.count = item.pack
                        return item.count -= item.pack
                    }
                    if (item.count <= 1) return;
                    item.count--;
                }
            })
        },
        //输入数量
        recInput(id) {
            this.recomendList.forEach(item => {
                if (item.goods_id === id) {
                    if (item.count <= 0 || isNaN(item.count)) {
                        item.count = item.is_separate === 1 ? item.pack : 1;
                        return;
                    }
                    const remainingQuota = item.quota - item.already;
                    if (item.count >= remainingQuota) {
                        this.$message("抱歉，已超过该商品限购量");
                        item.count = item.is_separate === 1
                            ? Math.floor(remainingQuota / item.pack) * item.pack
                            : remainingQuota;
                    }
                }
            });
        },
        //去详情页
        goOthers(id) {
            this.$router.push('/detail?id=' + id)
        },
        //批号搜索
        async codeSearch() {
            const params = {
                goods_id: this.goods.goods_id,
                batch_code: this.batch_code,
                product_code: this.goods.product_code
            }
            if (!this.batch_code) return this.$message('请输入批号')
            const res = await searchBatch(params)
            this.$message({
                message: res.data.msg,
                type: "warning"
            });
        },
        //下载商品证件
        async goodsDownload() {
            const res = await download({
                type: 0,
                id: this.goods.goods_id
            })
            console.log(res.data.data.dfile);
            handleExportZip('http://mall.huida.cc'+res.data.data.dfile,res.data.data.dfile.substring(18, 30))
        },
        //添加留言
        async writeMessage() {
            if (!this.tel || !this.content) return this.$message('请填写完整')
            const res = await addMessage({
                product_code: this.goods.product_code,
                tel: this.tel,
                content: this.content
            })
            if (res.data.state !== 1) return this.$message(res.data.result)
            this.$message({
                message: res.data.result,
                type: "success"
            });
            this.tel = ''
            this.content = ''
        }
    },
    watch: {
        //监听数量
        count: {
            handler(val) {
                const remainingQuota = this.goods.quota - this.goods.already;
                if (remainingQuota <= 0) return this.count = 0
                if (val <= 0 || isNaN(val)) {
                    this.count = this.goods.is_separate === 1 ? this.goods.pack : 1;
                    return;
                }
                if (this.goods.is_separate === 1 && val <= this.goods.pack) {
                    this.count = this.goods.pack;
                    return;
                }
                if (val > remainingQuota) {
                    this.$message("抱歉，已超过该商品限购量");
                    this.count = this.goods.is_separate === 1
                        ? Math.floor(remainingQuota / this.goods.pack) * this.goods.pack
                        : remainingQuota;
                }
            },
            immediate: true,
        },
        activeSelect: {
            handler(val) {
                if (val >= 5) {
                    this.$refs.moveul.style.left = -((val - 4) * 65) + 'px'
                } else {
                    this.$refs.moveul.style.left = 0
                }
            }
        },
        //监听路由
        $route: {
            handler() {
                this.getDetailList()
            }
        }
    }

}
</script>

<style scoped lang="scss">
.detailPage {
    background-color: #fff;
}
.sc_location {
    width: 1160px;
    margin: auto;
    height: 43px;
    line-height: 43px;
    color: #666;
    ul {
        margin: 0px;
        padding: 0px;
        list-style: none;
        li {
            list-style-type: none;
            float: left;
        }
    }
}
.sc_middle {
    width: 1160px;
    height: 460px;
    margin: auto;
    border: 1px solid #fff;
    .leftPic {
        width: 380px;
        height: 500px;
        float: left;
        .goodsPic {
            width: 380px;
            height: auto;
            margin: 0 auto;
            .previewPic {
                width: 378px;
                height: 378px;
                border: 1px solid #dfdfdf;
                position: relative;
                cursor: move;
                .act_tag {
                    width: 88px;
                    height: 112px;
                    background: url('http://mall.huida.cc/picture/home/activity_tag.png?v=1.0.0')
                        no-repeat;
                    position: absolute;
                    top: 0;
                    right: 0;
                    background-position: 0px -119px;
                    pointer-events: none;
                }
                .special_tag {
                    display: block;
                    width: 98px;
                    height: 98px;
                    background: url('http://mall.huida.cc/picture/home/activity_tag.png?v=1.0.0')
                        no-repeat;
                    position: absolute;
                    background-position: -282px 0;
                    font-style: normal;
                    top: 0;
                    left: 0;
                }
                .promotion_tag {
                    display: block;
                    width: 98px;
                    height: 98px;
                    background: url('http://mall.huida.cc/picture/home/gifts_tag.png?v=1.0.0')
                        no-repeat;
                    position: absolute;
                    font-style: normal;
                    top: 0;
                    left: 0;
                }
                .mark {
                    width: 143px;
                    height: 154px;
                    background-color: #fff;
                    opacity: 0.5;
                    border: 1px solid #dfdfdf;
                    position: absolute;
                    left: 0;
                    top: 0;
                    pointer-events: none;
                    z-index: 99;
                }
                .largePic {
                    width: 378px;
                    height: 378px;
                    background: url('../../assets/img/ic_no_goods.png')
                        no-repeat;
                    background-size: 850px 850px;
                    position: absolute;
                    left: 390px;
                    top: 0;
                    z-index: 99;
                }
            }
            .scrollPic {
                clear: both;
                width: 380px;
                height: 75px;
                .prev {
                    display: block;
                    width: 20px;
                    height: 62px;
                    margin-top: 5px;
                    cursor: pointer;
                    text-decoration: none;
                    background: url('https://b2bmall.ahhdyy.net/picture/home/gallery/sc_left.jpg')
                        no-repeat;
                    float: left;
                }
                .next {
                    display: block;
                    width: 20px;
                    height: 62px;
                    margin-top: 5px;
                    cursor: pointer;
                    text-decoration: none;
                    background: url('https://b2bmall.ahhdyy.net/picture/home/gallery/sc_right.jpg')
                        no-repeat;
                    float: right;
                }
                .items {
                    float: left;
                    position: relative;
                    width: 340px;
                    height: 70px;
                    overflow: hidden;
                    ul {
                        position: absolute;
                        height: 60px;
                        margin: 5px;
                        display: flex;
                        justify-content: space-between;
                        li {
                            width: 60px;
                            text-align: center;
                            margin-left: 5px;
                            height: 60px;
                            position: relative;
                            i {
                                display: block;
                                border-right: 5px solid transparent;

                                border-left: 5px solid transparent;
                                width: 0px;
                                height: 0px;
                                position: absolute;
                                top: -5px;
                                z-index: 99;
                                left: 25px;
                            }
                            img {
                                padding: 2px;
                                width: 47px;
                                height: 55px;
                            }
                        }
                    }
                }
            }
        }
        .tooltip {
            color: #d63103;
            font-size: 13px;
            margin-top: 8px;
        }
    }
    .rightDesc {
        width: 740px;
        float: left;
        margin-left: 25px;
        color: #333;
        font-family: 思源黑体;
        letter-spacing: 0.5px;
        .goodsname {
            width: 740px;
            ul {
                margin: 0px;
                padding: 0px;
                li {
                    font-size: 20px;
                    font-weight: bold;
                    color: #333333;
                    list-style: none;
                    margin-bottom: 18px;
                    float: left;
                    line-height: 30px;
                }
            }
            .product-money {
                width: 710px;
                height: 72px;
                background: #f7f8fb;
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0 20px;
                .product-money-left {
                    display: flex;
                    .gongyin {
                        display: flex;
                        .discount {
                            font-size: 17px;
                            color: #999999;
                            margin-right: 20px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                        }
                        .count {
                            display: flex;
                            .discount-m {
                                font-size: 18px;
                                color: #f92b2b;
                                display: flex;
                                flex-direction: column;
                                justify-content: center;
                            }
                            .count-m {
                                font-size: 28px;
                                color: #f92b2b;
                                font-weight: bold;
                                margin-top: -5px;
                            }
                        }
                    }
                    .lingshou {
                        display: flex;
                        margin-left: 20px;
                        justify-content: center;
                        align-items: center;
                        .sale-mark {
                            font-size: 22px;
                            color: #333333;
                            display: flex;
                            align-items: center;
                        }
                        .sale-m {
                            font-size: 26px;
                            color: #333333;
                            margin-top: -5px;
                            font-weight: bold;
                        }
                    }
                    .coupon-later {
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        margin-left: 20px;
                        span {
                            padding: 5px 8px;
                            border-radius: 100px;
                            background: #ffeaea;
                            color: #f92b2b;
                        }
                    }
                }
            }
            .salesbox {
                width: 726px;
                height: 20px;
                padding: 12px;
                background-color: #f3f3f3;
                font-size: 12px;
                color: #666666;
                position: absolute;
                background-size: 100% 100%;
                &:hover {
                    height: auto;
                    b {
                        background: url('http://mall.huida.cc/picture/home/giftst.png')
                            no-repeat center 7px;
                    }
                    .inbox {
                        overflow: visible;
                    }
                }
                b {
                    display: inline;
                    width: 16px;
                    height: 16px;
                    float: right;
                    font-size: 14px;
                    text-align: center;
                    color: #666;
                    background: url('http://mall.huida.cc/picture/home/giftsb.png')
                        no-repeat center 7px;
                }
                .inbox {
                    display: block;
                    line-height: 24px;
                    height: 24px;
                    margin-right: 16px;
                    padding: 0;
                    overflow: hidden;
                    li {
                        font-size: 12px;
                        display: block;
                        line-height: 20px;
                        height: auto;
                        margin-bottom: 3px;
                        margin-right: 16px;
                        i {
                            width: 54px;
                            height: 24px;
                            color: #fff;
                            text-align: center;
                            float: left;
                            font-size: 14px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            background: linear-gradient(
                                179deg,
                                #ff9c83 0%,
                                #e76c25 100%
                            );
                            margin-top: -2px;
                        }
                        .saleContent {
                            width: 590px;
                            line-height: 20px;
                            margin-left: 96px;

                            span {
                                font-size: 16px;
                                color: #ff5722;
                            }
                        }
                    }
                }
            }
        }
        .sc_content {
            display: flex;
            flex-direction: column;
            line-height: 32px;
            .sc_content_top {
                width: 740px;
                padding-bottom: 10px;
                border-bottom: 1px dotted #f0f0f0;
                display: flex;
                justify-content: space-between;
                margin-top: 10px;
                float: left;
                .sc_content_quality {
                    flex: 0.65;
                    margin-right: 30px;
                }
            }
            .first {
                margin-right: 10px;
                color: #999999;
                font-size: 16px;
            }
            .second {
                color: #333333;
                font-size: 16px;
            }
            .mid_content {
                border-bottom: 1px dotted #f0f0f0;
                display: flex;
                .mid_first {
                    display: flex;
                    flex-direction: column;
                    padding-right: 20px;
                }
            }
        }
        .shopping {
            height: 36px;
            margin: 50px 0;
            display: flex;

            .computed {
                width: 96px !important;
                .numdown {
                    width: 29px;
                    height: 23px;
                    background-color: #f6f6f6;
                    border-radius: 0px 0px 0px 0px;
                    opacity: 1;
                    border: 1px solid #e2e2e2;
                    font-size: 16px;
                    font-weight: normal;
                    color: #333333;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    text-decoration: none;
                    -webkit-backface-visibility: hidden;
                    float: right;
                    line-height: 14px;
                    margin-right: -1px;
                }
                .numup {
                    width: 29px;
                    height: 23px;
                    background-color: #f6f6f6;
                    border-radius: 0px 0px 0px 0px;
                    opacity: 1;
                    border: 1px solid #e2e2e2;
                    font-size: 16px;
                    font-weight: normal;
                    color: #333333;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    text-decoration: none;
                    -webkit-backface-visibility: hidden;
                    margin-right: -1px;
                    text-align: center;

                    line-height: 14px;
                    float: right;
                }
                .countbox {
                    width: 60px;
                    height: 46px;
                    border-radius: 0px 0px 0px 0px;
                    border: 1px solid #e2e2e2;
                    border-right: 0;
                    background: #fff;
                    float: left;
                    text-align: center;
                    margin-right: -1px;
                    font-size: 18px;
                    color: #666;
                    line-height: 33px;
                    outline: 0;
                }
                .xiangou {
                    font-size: 12px;
                    font-weight: 500;
                    color: #b8b8b8;
                    float: left;
                    line-height: 20px;
                }
            }
            .addcar {
                width: 140px;
                height: auto;
                float: left;
                margin-left: 30px;
                text-decoration: none;
                a {
                    width: 144px;
                    box-sizing: border-box;
                    line-height: 38px;
                    text-align: center;
                    font-size: 20px;
                    color: #fff;
                    font-family: 'monospace';
                    margin-bottom: 17px;
                    background: #d63103;
                    border-radius: 2px;
                    text-decoration: none;
                    height: 49px !important;
                    display: flex !important;
                    justify-content: center !important;
                    align-items: center !important;
                }
            }
            .buycar {
                width: 140px;
                height: auto;
                float: left;
                margin-left: 30px;
                text-decoration: none;
                a {
                    background-color: #ffefe9;
                    text-decoration: none;
                    height: 49px !important;
                    display: flex !important;
                    justify-content: center !important;
                    align-items: center !important;
                    width: 138px;
                    line-height: 38px;
                    text-align: center;
                    font-size: 20px;
                    font-family: 'monospace';
                    border-radius: 2px;
                    border: 1px solid #d63103;
                    color: #ff5722;
                    opacity: 1.9 !important;
                }
            }
            .collect {
                color: #fff;
                border-radius: 1px;
                width: 109px;
                opacity: 1;
                border: 0;
                display: flex;
                justify-content: center;
                align-items: center;
                margin-top: 6px;
                margin-left: 30px;
                position: relative;
                font-size: 16px;
                font-family: 'monospace';
                text-align: left;
                cursor: pointer;
                .line {
                    position: absolute;
                    top: 24%;
                    left: 0;
                    width: 1px;
                    height: 20px;
                    border-radius: 0px 0px 0px 0px;
                    opacity: 1;
                    background-color: #e3e5ea;
                }
            }
        }
    }
}
.liselected {
    border: 1px solid #f60;
}
.iselected {
    border-bottom: 5px solid #f60;
}
.sc_foot {
    width: 1160px;
    margin: 50px auto;
    clear: both;
    margin-bottom: -20px;
    margin-top: 0;
    .recomend {
        width: 222px;
        height: 865px /*810px*/;
        clear: both;
        float: left;
        .recgoods {
            width: 218px;
            height: 46px;
            border: 1px solid #ccc;
            color: #5e5e5e;
            font-size: 16px;
            background: #f7f7f7;
            line-height: 46px;
            border-bottom: 0;
            text-align: center;
        }
        .defaultRecomend {
            border: 1px solid #ccc;
            width: 218px;
            padding: 15px 0;
            text-align: center;
            img {
                display: block;
                margin: 0 auto;
            }
            p {
                margin: 10px 15px 0;
                font-size: 14px;
                text-align: left;
                color: #ccc;
            }
        }
        .recomendPic {
            margin: 0px;
            margin-bottom: 6px;
            width: 220px;
            height: auto;
            float: left;
            position: relative;
            font-size: 12px;
            color: rgb(102, 102, 102);
            font-family: 思源黑体;
            box-sizing: border-box;
            border-width: 1px;
            border-style: solid;
            border-color: rgb(204, 204, 204);
            border-image: initial;
            background: rgb(255, 255, 255);
            &:hover {
                border: 1px solid #d63103;
                .store {
                    display: block;
                    border: 1px solid #d63103;
                }
                .collectImg {
                    display: block;
                    img {
                        overflow: hidden;
                        animation: expandImg 0.5s forwards;
                    }
                }
            }
            @keyframes expandImg {
                0% {
                    height: 0;
                }
                100% {
                    height: 100%;
                }
            }
            p {
                height: 20px;
                line-height: 20px;
                margin-left: 10px;
                white-space: nowrap;
                text-overflow: ellipsis;
                word-wrap: normal;
                overflow: hidden;
            }
            .recCar {
                height: 33px;
                margin-left: 10px;
                margin-top: 7px;
                .counter {
                    width: 88px;
                    height: 23px;
                    border: 1px solid #ccc;
                    float: left;
                    margin-right: 14px;
                    a {
                        width: 20px;
                        line-height: 23px;
                        height: 23px;
                        color: #ccc;
                        float: left;
                        text-align: center;
                        text-decoration: none;
                    }
                    input {
                        width: 46px;
                        height: 23px;
                        line-height: 23px;
                        text-align: center;
                        border: 1px solid #ccc;
                        border-top: none;
                        border-bottom: none;
                        float: left;
                        margin: 0px;
                        padding: 0px;
                    }
                }
                .add-car {
                    height: 49px !important;
                    display: flex !important;
                    justify-content: center !important;
                    align-items: center !important;
                    border: 1px solid #d55603;
                    background: #d63103;
                    color: #fff;
                    float: right;
                    width: 90px;
                    line-height: 23px;
                    text-align: center;
                    margin-right: 10px;
                }
            }
            .store {
                width: 220px;
                bottom: -52px;
                background: #fff;
                border-top: none;
                height: 40px;
                padding: 5px 0;
                position: absolute;
                left: -1px;
                z-index: 2;
                display: none;
                p {
                    height: 20px;
                    line-height: 20px;
                    margin-left: 10px;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    word-wrap: normal;
                    overflow: hidden;
                }
            }
            .recImg {
                margin: 15px 9px;
                height: 200px;
                overflow: hidden;
                text-align: center;
                img {
                    width: auto;
                    max-width: 100%;
                    height: auto;
                    max-height: 100%;
                    margin: auto;
                    border: none;
                    vertical-align: middle;
                }
                .act-tag-img {
                    width: 32px;
                    height: 60px;
                    background: url('http://mall.huida.cc/picture/home/activity_tag2.png?v=1.0.0')
                        no-repeat;
                    position: absolute;
                    background-position: 0px -56px;
                    right: 0;
                    top: -17px;
                }
            }
            .collectImg {
                display: none;
                background: #d63103;
                position: absolute;
                width: 100%;
                height: 25px;
                font-size: 12px;
                z-index: 99;
                line-height: 25px;
                top: 190px;
                div {
                    margin-left: 67px;
                    width: 20px;
                    height: 20px;
                    float: left;
                    margin: 2px 8px 0 87px;
                    background: url('http://mall.huida.cc/picture/home/cart_num.png')
                        no-repeat bottom;
                    img {
                        width: 100%;
                        height: 0%;
                    }
                }
            }
        }
    }
    .goodsdetail {
        width: 920px;
        height: auto;
        float: left;
        margin-left: 16px;
        .detailList {
            width: 921px;
            height: 47px;
            border-bottom: 1px solid #ccc;
            border-right: 1px solid #ccc;
            border-left: 1px solid #ccc;
            background: #f7f9f8;
            position: relative;
            border-top: 1px solid #ccc;
            ul {
                margin-left: 1px;
                list-style: none;
                li {
                    border-top: none;
                    margin-left: -1px;
                    float: left;
                    font-size: 16px;
                    line-height: 47px;
                    text-align: center;
                    width: 140px;
                    height: 47px;
                    letter-spacing: 0.5px;
                    cursor: pointer;
                    color: #5e5e5e;
                    position: relative;
                }
            }
        }
        .detailContent {
            border-top: 0;
            font-size: 16px;
            font-family: '思源黑体';
            width: 100%;
            height: auto;
            float: left;
            border: 1px solid #ccc;
            li {
                margin: 24px auto 20px auto;
                overflow: hidden;
                width: 850px;
                height: auto;
                line-height: 24px;
                font-size: 14px;
                min-height: /*680px*/ 745px;
                .addbtn {
                    border: 1px;
                    width: 71px;
                    height: 33px;
                    background-color: #d63103;
                    margin: 6px 16px 0 35px;
                    color: white;
                    line-height: 34px;
                    padding-left: 18px;
                    font-size: 14px;
                    margin-left: 312px;
                    float: right;
                }
                img {
                    overflow-clip-margin: content-box;
                    overflow: clip;
                    width: 100%;
                }
                .search {
                    padding: 20px 0;
                    width: 500px;
                    input {
                        font-family: inherit;
                        font-size: inherit;
                        font-style: inherit;
                        font-weight: inherit;
                        outline: 0;
                        border: 1px solid #ccc;
                    }
                    .a1 {
                        display: block;
                        height: 24px;
                        background-color: #69bcd7;
                        float: right;
                        text-align: center;
                        line-height: 24px;
                        color: #fff;
                        margin-left: 20px;
                        width: 100px;
                    }
                    .a2 {
                        display: block;
                        height: 24px;
                        background-color: #69bcd7;
                        float: right;
                        text-align: center;
                        line-height: 24px;
                        color: #fff;
                        width: 70px;
                    }
                }
            }
        }
    }
}
.i1 {
    display: block;
    width: 142px;
    height: 2px;
    background: #ff8c00;
    position: absolute;
    top: -1px;
    left: -1px;
}
.i2 {
    display: block;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #ff8c00;
    top: 1px;
    left: 65px;
    position: absolute;
}
.selectLi {
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    background: #fff;
}
.selectLiFirst {
    border-right: 1px solid #ccc;
    background: #fff;
}
.defaultBorder {
    border-left: none;
}
</style>
